use std::fmt::{self, Display};
use std::error::Error;

#[derive(Debug)]
pub struct YuzuError {
    reason: String,
}

impl YuzuError {
    pub fn new(reason: String) -> Box<Self> {
        Box::new(Self { reason })
    }
}

impl Display for YuzuError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "    yuzu err : {}", self.reason)
    }
}

impl Error for YuzuError {}